home *** CD-ROM | disk | FTP | other *** search
/ The Macintosh Demo Applications CD / Apple-MacintoshDemoApplicationsCD-1.0-1992.iso / More Information / Personal Press 2.0 / PPPouch / Additions / Text Columns / Continued Lines… / Continued Lines… next >
Text File  |  1992-06-08  |  7KB  |  278 lines

  1. on startup
  2. global bailout
  3. global onPrefix, fromPrefix
  4.  
  5. checkTextToolIsOn
  6. if bailout = false then
  7.  
  8. dialog129 
  9. if bailout = false then
  10.  
  11. put facingPages into hasFacingPages
  12. set lockscreen to true
  13. set lockcursor to true
  14. put currentPage into theCurrentPage
  15. if  hasFacingPages = TRUE then set facingPages to false
  16. set shuffletextobjects to false
  17. set mousecursor to busy
  18. put textfont into thefont
  19.  
  20. put currentstorynumber() into thestory
  21. put number(storyobjects in story theStory) into numObjects
  22. subtract 1 from numObjects
  23.  
  24. progressdialog open
  25. progressdialog show "Scanning pages…" "Continued Line Status"
  26.  
  27. repeat with i = 1 to number of pages
  28. set mousecursor to busy
  29. set currentpage to i
  30. put empty into item 1 of thecurrentobjectloc
  31. put empty into item 2 of thecurrentobjectloc
  32. repeat with j = 1 to numObjects
  33. set mousecursor to busy
  34.  
  35. put pageloc of object j of story theStory into theloc
  36. if item 1 of theloc = i then
  37. put theloc into thecurrentobjectloc
  38. put j into theTextObject
  39. put pageloc of object (j+1) of story theStory into theNextloc
  40. end if -- thecurrentobjectloc = currentpage
  41.  
  42. end repeat -- j = 1 to numObject
  43.  
  44. if item 1 of thecurrentobjectloc = i then
  45. if item 1 of theNextloc <> empty then
  46. createJumpLine thecurrentobjectloc,thestory,theNextloc,thefont
  47. end if
  48. end if
  49. end repeat -- i = 1 to number(pages)
  50. progressdialog close
  51. if  hasFacingPages = TRUE then set facingPages to TRUE
  52. set currentPage to theCurrentPage
  53.  
  54. end if
  55. end if
  56. end startup
  57.  
  58. on createJumpLine thecurrentobjectloc,thestory, theNextloc, thefont
  59. global onPrefix, fromPrefix
  60.  
  61.  
  62. if (item 1 of thecurrentobjectloc) <> (item 1 of theNextloc) then
  63. progressdialog show "creating Continued On line for page " ¬
  64. & (item 1 of thecurrentobjectloc)
  65. set mousecursor to busy
  66. set currentpage to (item 1 of thecurrentobjectloc)
  67. set mousecursor to busy
  68.  
  69. -- calc the size of the object required
  70. put the rect in points of object (item 2 of thecurrentobjectloc) into objRectangle    
  71. put item 1 of objRectangle into rectleft
  72. put item 3 of objRectangle into rectright
  73. put item 4 of objRectangle into rectbottom
  74. put rectbottom - 28 into recttop
  75.  
  76. -- now create the object and set its frame & fill properties
  77. set mousecursor to busy
  78. choose maintool
  79. open story "jumpline" & currentpage & thestory & ticks()
  80. draw rectangle in points from rectleft,recttop ¬
  81. to rectright,rectbottom
  82. close story
  83. set mousecursor to busy
  84. select objects number(objects)
  85. set frameLineType to 1
  86. set linePattern to 0 -- none
  87. set fillPattern to 0 -- none
  88. set mousecursor to busy
  89.  
  90. -- put the text in there and format it
  91. set stylerecomposition to false
  92. choose texttool
  93. put "(" & onPrefix && "continued on page " & (item 1 of theNextLoc) & ")" ¬
  94. into story currentStoryNumber()
  95. select all text
  96. set textfont to thefont
  97. set textSize to 10
  98. set textFace to italic
  99. set rulerJustification to right
  100. set stylerecomposition to true
  101.  
  102.  
  103. -- make the object the minimum size required to hold the jump line
  104. set mousecursor to busy
  105. choose maintool
  106. select empty
  107. select object number(objects)
  108. minimizeTextObjectSize
  109.  
  110. -- now put it at the bottom right corner
  111. select empty
  112. select object (item 2 of thecurrentobjectloc)
  113. select object number(objects)
  114. align to objects  right bottom
  115.  
  116. select empty
  117. select object number(objects)
  118. set textwrap  in points to 2 aroundRect
  119.  
  120.  
  121. -- NOW CREATE CONTINUED FROM LINE
  122. put "creating Continued From line for page " & (item 1 of theNextLoc) ¬
  123. into theStatus
  124. progressdialog show theStatus
  125. set mousecursor to busy
  126. set currentpage to (item 1 of theNextLoc)
  127. set mousecursor to busy
  128. put the rect in points of object (item 2 of theNextLoc) into objRectangle
  129.  
  130. put item 1 of objRectangle into rectleft
  131. put item 3 of objRectangle into rectright
  132. put item 2 of objRectangle into recttop
  133. put recttop + 28 into rectbottom
  134. set mousecursor to busy
  135. choose maintool
  136. open story "jumplineF" & currentpage & thestory & ticks()
  137. draw rectangle in points from rectleft,recttop ¬
  138. to rectright,rectbottom
  139. close story
  140. set mousecursor to busy
  141. select objects number(objects)
  142. set frameLineType to 1
  143. set linePattern to 0 -- none
  144. set fillPattern to 0 -- none
  145. set mousecursor to busy
  146. set stylerecomposition to false
  147. choose texttool
  148. put "(" & fromPrefix && "continued from page " & (item 1 of thecurrentobjectloc) & ")" ¬
  149. into story currentStoryNumber()
  150. select all text
  151. set textfont to thefont
  152. set textSize to 10
  153. set textFace to italic
  154. set rulerJustification to left
  155. set stylerecomposition to true
  156.  
  157.  
  158. -- make the object the minimum size required to hold the jump line
  159. set mousecursor to busy
  160. choose maintool
  161. select empty
  162. select object number(objects)
  163. minimizeTextObjectSize
  164.  
  165. -- now put it at the bottom right corner
  166. choose maintool
  167. select empty
  168. select object (item 2 of theNextLoc)
  169. select object number(objects)
  170. align to objects  left top
  171.  
  172. -- now apply text wrap
  173. select empty
  174. select object number(objects)
  175. set textwrap  in points to 2 aroundRect
  176. progressdialog show "Scanning pages…"
  177.  
  178.  
  179. end if
  180. end createJumpLine
  181.  
  182. on minimizeTextObjectSize
  183.  
  184. put measurements into oldmeasure
  185. set measurements to points
  186. put selectedObjects() into theSelection
  187. choose textTool
  188. select all text
  189. put the textSelectionBounds in points into theBounds
  190. put insetRect(theBounds,-5,-5) into theBounds
  191. put (item 4 of theBounds ) - ( item 2 of theBounds ) into theHeight
  192. set  height of object (item 1 of theSelection) to theHeight
  193. select object (item 1 of theSelection)
  194. choose textTool
  195. if not StoryFits(story currentStoryNumber()) then
  196. copyFit
  197. end if
  198. select object (item 1 of theSelection)
  199. set measurements to oldmeasure
  200. end minimizeTextObjectSize
  201.  
  202. on checkTextToolIsOn
  203. global bailout
  204.  
  205. put "true" into bailout
  206.  
  207. if toolmode <> "textTool" then
  208. answer "The TextTool must be turned on."
  209. else if currentStoryNumber() = "none" then
  210. answer "The text cursor must be blinking in a story."
  211. else
  212. put "false" into bailout
  213. end if
  214.  
  215. end checkTextToolIsOn
  216.  
  217. on dialog129
  218. global onPrefix, fromPrefix, bailout
  219.  
  220. put empty into onPrefix
  221. put empty into fromPrefix
  222.  
  223. put  dialog (preload, 129) into thedialog
  224.  
  225. setDialogItem 7, contents, "See “"&userName of story currentstorynumber() &"”:"
  226. setDialogItem 8, contents, "“"& userName of story currentstorynumber() &"”:"
  227.  
  228. repeat forever
  229. setDialogItem 4, Doubleline
  230. setDialogItem 11, Grayline
  231. get dialog(display, thedialog)
  232. switch it
  233. case 1
  234. exit repeat
  235. exit switch
  236. case 2
  237. put "true" into bailout
  238. exit dialog129
  239. exit switch
  240. case 3
  241. helpDialog 128, "Continued Lines Help"
  242. get dialog(view, thedialog)
  243. exit switch
  244. end switch
  245.  
  246. end repeat
  247.  
  248. put contentsof(item7) into onPrefix
  249. put contentsof(item8) into fromPrefix
  250.  
  251. get dialog(dispose, thedialog)
  252. end dialog129
  253.  
  254. function contentsof thedata
  255. put itemdel into OldItemDel
  256. set itemdel to "\"
  257. get item 2 of thedata
  258. set itemdel to OldItemDel
  259. return it
  260. end contentsof
  261.  
  262. on help
  263.  
  264. put  dialog (preload, 128) into thedialog
  265. put "---a\0" into item2
  266. put "---a\1" into item3
  267. put "---a\2" into item4
  268.  
  269.  
  270. repeat forever
  271. get dialog(display, thedialog)
  272. if (it = 1) then exit repeat
  273. end repeat
  274. get dialog(dispose, thedialog)
  275.  
  276. end help
  277.  
  278.     yz<BÏ